package com.srini.util;

import java.util.Calendar;
import java.util.concurrent.TimeUnit;

public class AppUtil {

	public static boolean isEmpty(String str) {
		if (str == null) {
			return true;
		}
		if (str.trim().equals("")) {
			return true;
		}

		return false;
	}

	public static long daysBetween(Calendar startDate, Calendar endDate) {

		startDate.set(startDate.get(Calendar.YEAR),
				startDate.get(Calendar.MONTH), startDate.get(Calendar.DATE), 0,
				0, 0);

		long daysBetween = TimeUnit.DAYS.convert(endDate.getTimeInMillis()
				- startDate.getTimeInMillis(), TimeUnit.MILLISECONDS);

		return daysBetween;
	}
}
